package org.example.webdav.resources;

import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties("webdav.creds")
public class WebDavCreds {

    private String host;
    private int port=80;
    private String user;
    private String pass;

    public void setHost(String host) {
        this.host = host;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public AuthScope getAuthScope(){
        return new AuthScope(this.host, this.port);
    }

    public UsernamePasswordCredentials getCredentials(){
        return new UsernamePasswordCredentials(user, pass);
    }
}
